#ifndef _ACTION_MANAGE
#define _ACTION_MANAGE

#include <iostream>


typedef enum
{
   ACT_FINISHED,
   ACT_RUNNING,
   ACT_TIMEDOUT_GRPC,
   ACT_TIMEDOUT_APP,
}en_action_status;


typedef struct _action_desc
{
    int actId;
    int status;
    int statusCode;
    int errorNum;
    struct _action_desc * next;
}action_desc;


class CActionMange
{
private:
   action_desc * m_listActionHead;
   action_desc * m_ptrTail;
   int m_numAct;
public:
   CActionMange();
   void register_action(int actId, int actStatus);
   void setActStatus(int actId, int actStatus);

   int getActStatus(int actId, int* statusCodeOut, int * errorNum);
   int getActStatus(int actId);
   void updateAction(void * dataRecv);


   action_desc * findNodeById(int actId);

   virtual ~CActionMange();
};

extern CActionMange * g_ptrEleCtlManage;
extern CActionMange * g_ptrModuleManage;

void * funcRecvAck(void * param);
extern int appAckRecvexitFlag;
#endif